import { createRouter, createWebHistory } from 'vue-router'
import goodsView from '@/views/goods/index.vue'
import userview from '@/views/user/index.vue'
import userloginView from '@/views/user/userlogin.vue'
import layoutView from '@/views/layout/index.vue'
import indexView from '@/views/index/index.vue'
import projectView from '@/views/project/index.vue'
import levelView from '@/views/level/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: layoutView,
      children:[
      {path: '/', redirect: '/index'},
      {path: '/index',name: 'index',component: indexView},
      {path: '/user',name: 'user',component: userview},
      {path: '/goods',name: 'goods',component: goodsView},
      {path: '/nursingProject',name: 'nursingProject',component: projectView},
      {path: '/nursingLevel',name: 'nursingLevel',component: levelView},
    ]},{path: '/user/login',name: 'userlogin',component: userloginView},
    
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
  ],
})

export default router
